<template>
  <el-card shadow="never" class="list-card">
    <div slot="header" style="text-align: center">
      <span>考评计划基本信息</span>
    </div>
    <el-form label-width="100px">
      <el-form-item label="考评计划名称:">
        <span>{{ item.evalPlanName }}</span>
      </el-form-item>
      <el-form-item label="考评计划类型:">
        <span>{{ item.evalPlanType && item.evalPlanType === 1 ? '常规计划' : '专项计划' }}</span>
      </el-form-item>
      <el-form-item label="考评计划周期:">
        <span>{{ judgeRange(item.evalPlanCycle) }}</span>
      </el-form-item>
      <el-form-item label="计划执行次数:">{{ item.evalPlanCycleNum }}</el-form-item>
      <el-form-item label="计划日期:">
        <span>{{ item.startDate }}{{ item.endDate ? `至${item.endDate}` : null }}</span>
      </el-form-item>
      <el-form-item label="考评形式:">
        <span>{{ item.evalMode && item.evalMode === 1 ? '填报' : '巡查' }}</span>
      </el-form-item>
      <el-form-item
        label="考核对象形式:"
      >{{ item.targetMode === 1 ? '指定部门' : ( item.targetMode === 2 ? '指定个人' : '全部人员' ) }}</el-form-item>
      <el-form-item label="计划状态:">
        <span>
          <el-tag :type="judgeType(item.state)">{{ judgeState(item.state) }}</el-tag>
        </span>
      </el-form-item>
      <el-form-item label="创建人:">{{ item.createUser }}</el-form-item>
      <el-form-item label="创建时间:">{{ formatTime(item.createTime) }}</el-form-item>
    </el-form>
  </el-card>
</template>

<script>
import { judgeRange, judgeEvalState, judgeType } from '@/utils/util'

export default {
  data() {
    return {
      item: {}
    }
  },
  methods: {
    show(row) {
      this.item = row
    },
    judgeType(num) {
      return judgeType(num)
    },
    judgeState(num) {
      return judgeEvalState(num)
    },
    judgeRange(num) {
      return judgeRange(num)
    }
  }
}
</script>

<style scoped>
.list-card .el-form .el-form-item {
  margin-bottom: 10px;
}
</style>